home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
tcomm50.zip
/
LWXM.DOC
< prev
next >
Wrap
Text File
|
1987-10-07
|
22KB
|
855 lines
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
-CONTENTS-
INTRODUCING LWXM. . . . . . . . . . . . . . . . . . . . . 1
DIFFERENCES BETWEEN XMODEM AND WXMODEM. . . . . . . . . 1
PROTOCOL FUNDAMENTALS . . . . . . . . . . . . . . . . . 2
THE TRANSMISSION BLOCK. . . . . . . . . . . . . . . . 2
THE INTER-COMPUTER DIALOG . . . . . . . . . . . . . . 3
THE WLXM ENGINE . . . . . . . . . . . . . . . . . . . . . 3
OVERVIEW. . . . . . . . . . . . . . . . . . . . . . . . 4
MAJOR ENGINE COMPONENTS . . . . . . . . . . . . . . . . 5
NOTES AND WARNINGS. . . . . . . . . . . . . . . . . . . 6
MODIFICATIONS . . . . . . . . . . . . . . . . . . . . 6
PARITY AND DATA BITS. . . . . . . . . . . . . . . . . 6
INTERNAL TIMER FUNCTION . . . . . . . . . . . . . . . 6
BUFFER SIZE RESTRICTION . . . . . . . . . . . . . . . 7
XON-XOFF CONTROL. . . . . . . . . . . . . . . . . . . 7
USER-ACCESSABLE DATA. . . . . . . . . . . . . . . . . . 8
PROGRAMMERS REFERENCE . . . . . . . . . . . . . . . . . . 8
ENGINE-RELATED FUNCTIONS. . . . . . . . . . . . . . . . 9
lwxrrec . . . . . . . . . . . . . . . . . . . . . . . 10
lwxtrec . . . . . . . . . . . . . . . . . . . . . . . 12
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
DIFFERENCES BETWEEN XMODEM AND WXMODEM
This is not intended to be a strict tutorial on either
XMODEM or Windowed XMODEM (WXMODEM). We assume that you have
already read, digested, and understood the documentataion
provided for the LXM (XMODEM) engine. If not, your reading
should begin there.
The xmodem protocol, while very popular and a defacto
standard does have some built-in deficiencies. At least one
of these has been addressed by a variant, that of the block
checking used in the original protocol. But some other
deficiencies also exist. Chief among these deficiencies are
the amount of time required to 'turn around' the
transmission line after each block is sent to permit the
receiver to acknowledge successful receipt of the block.
This turn-around time is further complicated by the
relatively short block length, and as a result, the number
of times this turn-around occurs while transferring a file
of any substantial size.
A second area of concern for those who study communications
protocols is the relative ease with which xmodem can loose
synchronism between the sender and receiver, permitting the
protocol to be fooled. Several approaches have been
developed within the xmodem framework to address this
problem, but these must be viewed as work-around's that do
not really correct the problem, but rather mask the symptoms
of the problem.
Finally, xmodem does does perform well over certain
packet-based networks, such as TELENET. This is largely a
result of the the network's speed, and the use of XON-XOFF
flow control. Most xmodem implimentations, ours included, to
not respond well to what the sender perceives to be spurious
characters on the line, the XON and XOFF. In some cases,
xmodem will not function at all. In others, there may be the
needless retransmission of blocks because of the way in
which the XON and XOFF are handled.
CopyRight (c) 1987, Information Technology, Ltd.
INTRODUCING LWXM Page 1
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
PROTOCOL FUNDAMENTALS
THE TRANSMISSION BLOCK
WXMODEM transmission blocks closely mirror the xmodem
standard with several important distinctions. To improve the
ability of WXMODEM to handle false blocks or false Ends of
Transmission (EOT), an additional character has been added
to the block, SYN. To successfully recognize the begiining
of a block, the receiving program must successfully get one
or more SYN characters followed by the traditional SOH used
by xmodem.
While the addition of a synchronizing character helps, it
does not completely eliminate the possibility of the
receiver or sender being fooled, resulting in aborted
transmission or premature End of File conditions. To help
correct these problems, WXMODEM requires that all characters
in a block that might cause confusion be escaped. That is,
WXMODEM uses a technique long popular in the area of
synchronous communications called transparency. Using the
approach, certain data characters that might cause confusion
when they appear in a data block are altered and sent in a
special way that can be recognized easily by the receiver.
In WXMODEM these characters are SYN, XON, XOFF, and DLE. To
send any of these characters as part of the data, including
the block check, WXMODEM requires that the character be
preceeded by a DLE, and that a value of 64 (0x40) be added
to the actual character by the sender. The receiver
recognizes the leading DLE, removes it from the data stream,
and subtracts 64 (0x40) from the character that follows. The
problem of EOT confusion is addressed by a requirement that
two consectutive EOT's be received to be recognized as a
true End of File condition.
But perhaps the most unique design element in WXMODEM is the
way in which it address the line turn-around delay that we
discussed earlier. WXMODEM does not require that a
transmitted block be acknowledged immediately. Rather, the
sender will continue to transmit data until upto 4 blocks
CopyRight (c) 1987, Information Technology, Ltd.
INTRODUCING LWXM Page 2
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
have been sent before it (the sender) will stop to wait for
an acknowledgment. And the receiver is not required to
acknowledge each block individually, only the last block
that was successfully received, although the WXMODEM
description in fact suggests that all blocks be acknowledged
explicitly. The effect is that the sender can pause briefly
between blocks before starting to send again. The duration
of the pause should only be long enough to determine whether
there is any incoming acknowledgment to be handled. There is
no timeout interval as in xmodem until the 'window closes',
i.e. the sender has sent 4 unacknowledged blocks.
THE INTER-COMPUTER DIALOG
Rather than re-invent the wheel, we have included a copy of
the WXMODEM description, as developed by Peter Boswell. This
document is in the file WXMODEM.DOC for those who wish
further information on the subject.
CopyRight (c) 1987, Information Technology, Ltd.
THE WLXM ENGINE Page 3
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
OVERVIEW
The design of the WLXM engine closely mirrors that of the
original LXM engine, giving both capability and flexibility
in the use of communications protocols. Indeed, the WLXM
engine employs many of the same kernel routines used by our
LXM engine. As with LXM, virtually any application can have
access to this xmodem enhancement, without being religated
to simply transferring files.
CopyRight (c) 1987, Information Technology, Ltd.
THE WLXM ENGINE Page 4
LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
for Datalight and Turbo C
MAJOR ENGINE COMPONENTS
The WLXM engine consists, primarily of two functions,
lwxrrec and lwxtrec, receive a record and transmit a record
respectively. As with LXM, these two functions 'understand'
the wxmodem internally. Due to the nature of the protocol,
and unlike xmodem, they share the responsibility for proper
operation with t